﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Weibo4Sharp.Model;
using Hammock.Web;

namespace Weibo4Sharp.Service
{
    public partial class WeiboService
    {
        public IEnumerable<WeiboStatus> ListFavorites(int page = 1)
        {
            return WithHammock<IEnumerable<WeiboStatus>>("favorites" + FormatAsString,
                "?page=", page);
        }

        public WeiboStatus AddFavorite(long id)
        {
            return WithHammock<WeiboStatus>(WebMethod.Post,
                "favorites/create" + FormatAsString,
                "?id=", id);
        }

        public WeiboStatus DeleteFavorite(long id)
        {
            return WithHammock<WeiboStatus>(WebMethod.Delete,
                "favorites/destroy/{id}", FormatAsString,
                "?id=", id);
        }

        public IEnumerable<WeiboStatus> DeleteFavorites(IEnumerable<object> ids)
        {
            return WithHammock<IEnumerable<WeiboStatus>>(WebMethod.Delete,
                "favorites/destroy_batch", FormatAsString,
                "?ids=", ids);
        }

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibos()
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites", FormatAsString);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibos(int page)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites", FormatAsString, "?page=", page);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibos(int page, int count)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites", FormatAsString, "?page=", page, "&count=", count);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibosFor(int userId)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites/{user_screen_name}", FormatAsString, "?user_id=", userId);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibosFor(int userId, int page)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites/{user_screen_name}", FormatAsString, "?user_id=", userId, "&page=", page);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibosFor(int userId, int page, int count)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites/{user_screen_name}", FormatAsString, "?user_id=", userId, "&page=", page, "&count=", count);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibosFor(string userScreenName)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites/{user_screen_name}", FormatAsString, "?user_screen_name=", userScreenName);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibosFor(string userScreenName, int page)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites/{user_screen_name}", FormatAsString, "?user_screen_name=", userScreenName, "&page=", page);
        //}

        //public virtual IEnumerable<WeiboStatus> ListFavoriteWeibosFor(string userScreenName, int page, int count)
        //{
        //    return WithHammock<IEnumerable<WeiboStatus>>("favorites/{user_screen_name}", FormatAsString, "?user_screen_name=", userScreenName, "&page=", page, "&count=", count);
        //}

        //public virtual WeiboStatus FavoriteWeibo(long id)
        //{
        //    return WithHammock<WeiboStatus>(WebMethod.Post, "favorites/create/{id}", FormatAsString, "?id=", id);
        //}

        //public virtual WeiboStatus UnfavoriteWeibo(long id)
        //{
        //    return WithHammock<WeiboStatus>(WebMethod.Delete, "favorites/destroy/{id}", FormatAsString, "?id=", id);
        //}       

    }
}
